package basic;

import java.time.LocalTime;

public class StaticDemo {

    public static void main(String[] args) {
        System.out.println("main 代码块======"+LocalTime.now().toString());
        sleep(1000);
        System.out.println("date="+StaticDemo.date);
        System.out.println("main 代码块======");

    }

    static String date = null;
    static {
        System.out.println("static 代码块======");
        sleep(1000);
        date = LocalTime.now().toString();
        System.out.println("static 代码块======");
    }


    public static void sleep(long mis){
        try {
            System.out.println("start-sleep" + LocalTime.now().toString());
            Thread.sleep(mis);
            System.out.println("end-sleep");
        } catch (InterruptedException e) {

        }
    }
}
